import React from "react";
import ReactDOM from "react-dom/client";
import Counter1 from "./components/Counter1";
import Counter2 from "./components/Counter2";

// let counterValue = document.getElementById("counterValue");
// let counterAdd = document.getElementById("counterAdd");
// let counterMinus = document.getElementById("counterMinus");
// let reducer = (state = 0, action) => {
//   switch (action.type) {
//     case "ADD":
//       return state + 1;
//     case "MINUS":
//       return state - 1;
//     default:
//       return state;
//   }
// };
// let store = createStore(reducer);
// // console.log(store);
// // console.log(store.getState());
// // store.dispatch({ type: "ADD" });
// // console.log(store.getState());
// function render() {
//   counterValue.innerHTML = store.getState();
// }
// store.subscribe(render);
// counterAdd.addEventListener("click", () => {
//   store.dispatch({ type: "ADD" });
// });

// counterMinus.addEventListener("click", () => {
//   store.dispatch({ type: "MINUS" });
// });

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <React.StrictMode>
    <Counter1 />
    <Counter2 />
  </React.StrictMode>
);
